<div id="container">
<div class="eventos form">
    
	<h1>Gerenciar Eventos</h1>
         <table>
   
    <tr><td higth="40%">Pesquisar Evento</td></tr>
    <tr><td  higth="40%">
            
                
       
        
         <?php 
            
echo $this->Search->create();

echo $this->Search->selectFields('filter1',
        array(
            'Evento.nomeEvento'       => __('Nome', true),
            'Evento.localEvento'     => __('Local', true),
            
            'Evento.aprovar' => __('Aprovado', true),
            
            
        ),
        array(
            'class' => 'select-box'
        )
    );

echo $this->Search->selectOperators('filter1',
        array(
            'LIKE' => __('contendo', true),
            '='    => __('igual', true)
        )
    );

echo $this->Search->input('filter1');
echo $this->Search->end(__('Pesquisar', true));
              
              
       ?>  
            
            
        </td></tr>
    </table>
	<table cellpadding="0" cellspacing="0">
	<tr>
			
			<th><?php echo $this->Paginator->sort(' Nome '); ?></th>
			<th><?php echo $this->Paginator->sort(' Data '); ?></th>
			<th><?php echo $this->Paginator->sort(' Horário '); ?></th>
			<th><?php echo $this->Paginator->sort(' Local'); ?></th>
			<th><?php echo $this->Paginator->sort(' Telefone '); ?></th>
			<th><?php echo $this->Paginator->sort(' Endereço '); ?></th>
			<th><?php echo $this->Paginator->sort(' Cidade '); ?></th>
			<th><?php echo $this->Paginator->sort(' Estado '); ?></th>
			<th><?php echo $this->Paginator->sort(' Genero '); ?></th>
			<th><?php echo $this->Paginator->sort(' Preço'); ?></th>
			<th><?php echo $this->Paginator->sort(' Bandas '); ?></th>
                         <th><?php echo $this->Paginator->sort(' Promoter '); ?></th>
                        <th><?php echo $this->Paginator->sort(' Aprovação '); ?></th>
         	
			<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
         
               
                
                foreach($eventos as $evento): ?>
     
	<tr>
		
		<td><?php echo h($evento['Evento']['nomeEvento']); ?>&nbsp;</td>
		<td><?php echo h($evento['Evento']['dataEvento']); ?>&nbsp;</td>
		<td><?php echo h($evento['Evento']['horarioEvento']); ?>&nbsp;</td>
		<td><?php echo h($evento['Evento']['localEvento']); ?>&nbsp;</td>
		<td><?php echo h($evento['Evento']['telefoneEvento']); ?>&nbsp;</td>
		<td><?php echo h($evento['Evento']['enderecoEvento']); ?>&nbsp;</td>
		<td><?php echo h($evento['Evento']['cidadeEvento']); ?>&nbsp;</td>
		<td><?php echo h($evento['Evento']['estadoEvento']); ?>&nbsp;</td>
		<td><?php echo h($evento['Evento']['tipoEvento']); ?>&nbsp;</td>
		<td><?php echo h($evento['Evento']['precoEvento']); ?>&nbsp;</td>
		<td><?php echo h($evento['Evento']['bandasEvento']); ?>&nbsp;</td>
                <td><?php echo h($evento['Evento']['usuario_Nome']); ?>&nbsp;</td>
                <td><?php echo h($evento['Evento']['aprovar']); ?>&nbsp;</td>
               
		
                
		<td class="actions">
			
			<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $evento['Evento']['id'])); ?>
			<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $evento['Evento']['id']), null, __('Are you sure you want to delete # %s?', $evento['Evento']['id'])); ?>
                    
                        <?php
                            $role = $this->Session->read('Auth.User.role_id');
           
                             if($role == 1){
                                 echo $this->Html->link(__('Aprovar'), array('action' => 'aprovar', $evento['Evento']['id']));
                             }
                        ?>
                    
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Pagina {:page} de {:pages}, Mostrando {:current} registros  no total de{:count}')
	));
	?>	</p>

	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>

                
	<h2>Deseja cadastro novo evento ?</h2>
 <h2>É gratuito e sempre será . <?php echo $this->Html->link('Cadastrar-se',array('controller'=>'eventos','action'=>'add','class'=>'submit'))?></h2>
		
 
  </div>             

